package cn.pli.bike.ui;

import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

import com.framemodule.base.BaseDelegate;
import com.framemodule.widgets.Text;

import java.util.ArrayList;
import java.util.List;

import cn.pli.bike.R;

/**
 * 我的钱包
 */
public class YourWalletDelegate extends BaseDelegate {
    private TextView tvTitle;
    private TextView tvTitleRight;


    private RecyclerView recyclerViewProblem;
    private RechargeAdapter problemTypeAdapter;
    private TextView tvYourWallet;
    private TextView tvYouyDeposit;

    private List<Integer> moneys;


    @Override
    public void initTitleBar() {

    }

    @Override
    public int getRootLayoutId() {
        return R.layout.activity_your_wallet;
    }

    @Override
    public void initWidget() {
        super.initWidget();
        tvTitle = get(R.id.tv_title);
        tvTitle.setText(R.string.your_wallet);
        tvTitleRight = get(R.id.tv_title_right);
        tvTitleRight.setVisibility(View.VISIBLE);
        tvYourWallet = get(R.id.tv_your_wallet_detail);
        tvYouyDeposit = get(R.id.tv_your_deposit_detail);


        recyclerViewProblem = get(R.id.recycler_problem_list);
        problemTypeAdapter = new RechargeAdapter(recyclerViewProblem);
        recyclerViewProblem.setLayoutManager(new GridLayoutManager(this.getActivity(), 2));
        recyclerViewProblem.setAdapter(problemTypeAdapter);
        initMoney();

    }

    public RecyclerView getRecyclerView() {
        return recyclerViewProblem;
    }

    public RechargeAdapter getProblemTypeAdapter() {
        return problemTypeAdapter;
    }

    public void setProblemTypeAdapter(RechargeAdapter problemTypeAdapter) {
        this.problemTypeAdapter = problemTypeAdapter;
    }

    public void setTvTitle(String title) {
        tvTitle.setText(title);
    }

    public RecyclerView getRecyclerViewProblem() {
        return recyclerViewProblem;
    }


    public TextView getTvYourWallet() {
        return tvYourWallet;
    }


    public TextView getTvYouyDeposit() {
        return tvYouyDeposit;
    }

    private void initMoney() {
        moneys = new ArrayList<>();
        moneys.add(10);
        moneys.add(20);
        moneys.add(50);
        moneys.add(100);
        problemTypeAdapter.setData(moneys);
    }


}
